import React from "react";
import { ConfigProvider } from "antd";//国际化的组件
import zhCN from "antd/lib/locale/zh_CN";//中文包
import enUS from "antd/lib/locale/en_US";//英文包
// 引入自定义的
import { useAppSelector } from "@/app/hooks";
import { selectLang } from "@/app/slice";

import { RenderRoutes } from "./routes";

function App() {
  const lang = useAppSelector(selectLang);
// <ConfigProvider locale={lang === "zh_CN" ? zhCN : enUS}>这个是做一个国际化的，提供翻译的
  return <ConfigProvider locale={lang === "zh_CN" ? zhCN : enUS}>{RenderRoutes()}</ConfigProvider>;
}

export default App;
